function [logoaxes,logo] = xb_create_logo(fig,cx,cy)

%XB_CREATE_LOGO Summary of this function goes here
%
%   XB_CREATE_LOGO(varagin) Detailed explanation goes here
%
%   Inputs:
%
%
%   Outputs:
%
%
%   Syntax:
%
%
%   Example:
%
%
%   See also:
%
% 
%   Author(s): Xiaobiao Huang
%   Copyright 2013-2020 The Xiaobiao Studio.
%   $Revision: 1.0.0.0 $  $Date: 07-Jul-2013 20:51:59 $

pos = [cx cy 56 12];
logoaxes = axes( ...
    'HandleVisibility',  'off', ...
    'Parent',            fig, ...
    'Units',             'Pixels', ...
    'Position',          pos);

% substitute background color by figure color
defaultColor = get(0,'DefaultUicontrolBackgroundColor');
beigeColor = [236, 233, 216] / 255;
if all(defaultColor == beigeColor),
    cData = tl_get_icon('xstudio_Logo_56x12', 'BackgroundColor', beigeColor);
else
    cData = tl_get_icon('xstudio_Logo_56x12', 'BackgroundColor', defaultColor);
end
logo = image(cData, ...
    'Parent',            logoaxes);

% properties disappear when an axes object is associated with an image
set(logoaxes, ...
    'Tag',               'logoaxes', ...
    'UserData',          logo, ...
    'Visible',           'off', ...
    'Position',          pos);

end % end of function  xb_create_logo
